package sy8_1;

import java.util.HashSet;
import java.util.Iterator;

public class demo1 {
    public static void main(String[] args) {
        HashSet<Person> set=new HashSet<>();
       Person[] persons=new Person[]{
               new Person("zhangsan","13350557316","I am zhangsan"),
               new Person("zhangsan","13350557316","I am other zhangsan"),
               new Person("lisi","13350557310","I am lisi"),
               new Person("lisi","13350557390","I am wangwu"),
       };
        for (int i = 0; i < persons.length; i++) {
            set.add(persons[i]);
        }
        Iterator<Person> iterator=set.iterator();
        while (iterator.hasNext()){
            Person  person= iterator.next();
            System.out.println(person);
        }
    }
}
